package cn.jbolt.core.base;

/**
 * 平台主键生成策略
 *
 * @ClassName: JBoltIDGenMode
 * @author: JFinal学院-小木 QQ：909854136
 * @date: 2021年1月23日
 */
public interface JBoltIDGenMode {
	String AUTO = "auto";
	String AUTO_LONG = "auto_long";
	String AUTO_STRING = "auto_string";
	String UUID = "uuid";
	String ASSIGN_STRING = "assign_string";
	String ASSIGN_INT = "assign_int";
	String ASSIGN_LONG = "assign_long";
	String SEQUENCE = "sequence";
	String SEQUENCE_LONG = "sequence_long";
	String SERIAL = "serial";
	String BIGSERIAL = "bigserial";
	String SNOWFLAKE = "snowflake";
	String SNOWFLAKE_STRING = "snowflake_string";

	/**
	 * 判断是否需要手工赋值
	 *
	 * @param idGenMode
	 * @return
	 */
	static boolean isNeedSysAutoAssign(String idGenMode) {
		return UUID.equals(idGenMode) || SEQUENCE.equals(idGenMode) || SEQUENCE_LONG.equals(idGenMode)
				|| SNOWFLAKE.equals(idGenMode)||SNOWFLAKE_STRING.equals(idGenMode);
	}
}
